home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <a2410/typedefs.h>
- #include <a2410/devtiga.h>
- #include <clib/a2410_protos.h>
- #include <math.h>
-
- BOOL TIGA_Init(void);
- void TIGA_Close(void);
- void TIGA_Break(void);
- void TIGA_SetRandPalet(void);
-
- void BoxDemo(void);
- /* ================================================================================ */
- void main(int argc, char **argv)
- {
- if (TIGA_Init())
- {
- onbreak(TIGA_Break);
- TIGA_SetRandPalet();
- BoxDemo();
- TIGA_Close();
- }
- }
-
- /* ------------------------------------------------------------------------------- */
-
- void BoxDemo()
- {
- int x,y,w,h,i;
- CONFIG config;
-
- get_config(&config);
-
- for (;;)
- {
- chkabort();
- w = rand() % (config.mode.disp_hres-1)+1;
- h = rand() % (config.mode.disp_vres-1)+1;
- x = rand() % (config.mode.disp_hres-w);
- y = rand() % (config.mode.disp_vres-h);
- i = rand() % config.mode.palet_size;
- set_fcolor(i);
- fill_rect(w, h, x, y);
- }
- }
-
- /* ------------------------------------------------------------------------------- */
-